package com.kunsan.compose.widget

import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import com.kunsan.compose.R

@Composable
fun ToggleSpeakerAction(
    modifier: Modifier = Modifier,
    isSpeakerMuted: Boolean,
    enabled: Boolean = true,
    onCallAction: (Boolean) -> Unit,
) {
    val speakerIcon =
        painterResource(
            id = if (isSpeakerMuted) {
                R.drawable.icon_chat_speaker_off
            } else {
                R.drawable.icon_chat_speaker_on
            },
        )
    Image(
        modifier = Modifier
            .clickable(enabled = enabled) {
                onCallAction(
                    isSpeakerMuted.not(),
                )
            },
        painter = speakerIcon,
        contentDescription = "",
    )
//    CallControlActionBackground(
//        modifier = modifier
//    ) {
//
//    }
}
